package com.fuchuang.seckillsystem.service.impl;

import com.fuchuang.seckillsystem.entity.PreliminarySelect;
import com.fuchuang.seckillsystem.mapper.PreliminarySelectMapper;
import com.fuchuang.seckillsystem.service.IPreliminarySelectService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
@Slf4j
public class PreliminarySelectServiceImpl implements IPreliminarySelectService {
    
    @Resource
    private PreliminarySelectMapper preliminarySelectMapper;
    
    @Override
    public void addPreliminarySelect(PreliminarySelect preliminarySelect) {
        //初筛添加失败不影响用户登录总体流程
        try {
            int rows = preliminarySelectMapper.insert(preliminarySelect);
            if (rows != 1) {
                throw new RuntimeException("初筛记录添加失败");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
